﻿@model IEnumerable<FCNS.ERP.Models.ErpRoom>

@{
    ViewBag.Title = "退房&交租";
    Layout = "~/Views/Shared/_Layout.cshtml";
}

<h2>@ViewBag.Title </h2>
 
<script type="text/javascript">
    $(document).ready(function () {
        $(".tuiFang").click(function () {
            if (confirm("确定所有费用已经结清并退房吗？") == true)
            {
                window.location.replace('TroomNew/' + $(this).attr("data-roomId"));
            }
        });
        });
</script>

<table class="table">
    <tr>
        <th>
            @Html.DisplayNameFor(model => model.CategoryHouse.Name)
        </th>  
        <th>
            @Html.DisplayNameFor(model => model.Name)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Price)
        </th>
        <th>
            @Html.DisplayNameFor(model => model.Summary)
        </th>
        <th></th>
    </tr>

@foreach (var item in Model) {
    <tr>
        <td>
            @Html.DisplayFor(modelItem => item.CategoryHouse.Name)
        </td> 
        <td>
            @Html.DisplayFor(modelItem => item.Name)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Price)
        </td>
        <td>
            @Html.DisplayFor(modelItem => item.Summary)
        </td>
        <td>
            @Html.ActionLink("定义费用项目", "TroomCostEdit", new { id = item.Id }) |
            @Html.ActionLink("打印合同", "ReportPrint", new { flag = 1, str1 = item.Id }, htmlAttributes: new { @target = "_blank" }) |
            <a href="#" class="tuiFang" data-roomId=@item.Id>退房</a> |
            @Html.ActionLink("结算", "CostCalc", new { id = item.Id }) 
        </td>
    </tr>
}

</table>
